﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <link href="~/Content/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <script src="~/Content/bootstrap/js/jquery-1.8.3.js"></script>
    <script src="~/Content/bootstrap/js/bootstrap.min.js"></script>
    <script src="/Scripts/layer/layer.js"></script>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    <title>深圳凡曦电子商务有限公司</title>
    <style type="text/css">
        html {
            margin: 0px;
            padding: 0px;
            width: 100%;
            height: 100%;

        }

        body {
            width: 100%;
            height: 100%;
            background-color: white;
        }
        .row-fluid .span12,.span12 {
            margin: 0px;
            padding: 0px;
            text-align: center;
        }

        .content {
            width: 100%;
            height: 100%;
            background-image: url(../Content/images/backs_img.png);
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }
        .container-fluid {
            width: 100%;
            height: 100%;
            margin:0px;
            padding:0px;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            $("#txt_userName").focus();
        })
        function GetLogin() {
            var userName = $("#txt_userName").val();
            var userPwd = $("#txt_userPwd").val();
            if(userName == '')
            {
                layer.msg("请输入用户名！");
                return false;
            }
            if (userPwd == '')
            {
                layer.msg("请输入用密码！");
                return false;
            }

                $.ajax({
                    type: "Post",
                    url: "/Login/GetLogin",
                    data: { "userName": userName, "userPwd": userPwd },
                    dataType: "json",
                    success: function (data) {
                        //alert(JSON.stringify(data));
                        if (data.MessageCode == "200") {
                            $("#txt_userPwd").val("");
                            layer.msg("登录失败！");
                          
                            return;
                        } else if (data.MessageCode == "100") {
                            layer.msg("用户名或密码错误！");
                            return;

                        }
                        else if (data.MessageCode == "50") {
                            layer.msg("改账号还未被审核！");
                            return;

                        } else if (data.MessageCode == "20") {
                            layer.msg("请用经销商用户登录！");
                            return;

                        } else {
                            
                            layer.msg("登录成功！"); setTimeout(function () {
                                window.location.href = "/Home/Index";
                            }, 2000)
                             
                          
                        }
                    }
                })
            }
        
    </script>
</head>
<body>
    <div class="content">
        <div class="container-fluid" style="padding:0px;">
            <div class="row-fluid">

                <div class="span12" style="top: 17%;position: absolute;">
                    <img src="~/Content/images/btitle_img.png" style="width:55%;" />
                </div>

            </div>
            <div style="width:97%;top:45%;position:absolute; ">
                <div class="row-fluid">

                    <div class="span12">
                        <span style="width:50px; font-weight:bold;">登录名:</span><span><input type="text" placeholder="请输入手机号" id="txt_userName" style="height:25px;" /></span>
                    </div>
                    <div class="span12" style="padding-top:10px;">
                        <span style ="width: 50px; font-weight: bold;">密&nbsp;&nbsp;&nbsp;码:</span><span><input type="password" placeholder="密码为手机号后六位" id="txt_userPwd" style="height:25px;" /></span>
                    </div>
                    <div class="span12" style="padding-top:25px;">
                        <span>
                            <img src="~/Content/images/top_img.png"  style="width:50%; margin-left:13%;" onclick="GetLogin();" /></span>
                    </div>
                </div>
            </div>
            <div style="position: fixed; bottom: 0; width: 97%; color:#504b4b">
                <div class="row-fluid">
                    <div class="span12">
                        <span >技术架构：上海诺标 版权所有</span>
                    </div>
                </div><div class="row-fluid">
                    <div class="span12">
                       <span>Copyright 2016-2020 All Reserved</span>
                    </div>
                </div>

            </div>
        </div>
    </div>

</body>
</html>
